﻿



CREATE view [dbo].[vwPTSPearlReconciled]
as
SELECT
	 ISNULL(PTS.LobParent, CASE Pearl.ManagedSegmentCodeL6 WHEN '6719' THEN 'GFTS' ELSE 'ICG Tech' END) as [LobParent]
	 , ISNULL(PTS.Goc, Pearl.GOC) as GOC
	 , ISNULL(PTS.OTHead, Pearl.OTHead) as [OTHead]
	 , ISNULL(PTS.PTSLine, Pearl.PTSLine) as [PTSLine]
	 , ISNULL(Pearl.YTDAmount, 0) as [PearlYTDAmount]
	 , ISNULL(PTS.YTDAmount, 0) as [PTSYTDAmount]
FROM fn_ReconPTSPearl() as PTS
FULL OUTER JOIN FinancePlanningAnalysis.dbo.fn_ReconPTSPearl() AS Pearl 
	ON Pearl.Goc = PTS.Goc AND Pearl.PTSLine = PTS.PTSLine